<%@ page language="java" pageEncoding="utf-8" isELIgnored="false" import="com.onlineclass.bean.Course"%>

<%String title="购买的课程"; %>

<%@ include file="../header.jsp" %>

  <div class="container my-3" style="">
    <div class="list-group col-2 pull-left mr-2">
      <a href="http://bing.com" class="list-group-item list-group-item-action list-group-item-light">用户中心首页</a>
      <a href="my/orderList.do" class="list-group-item list-group-item-action">购买的课程</a>
      <a href="" class="list-group-item list-group-item-action">个人资料</a>
    </div>
    <div class="pull-left col-9">
      
    <c:set var="subject"/>
    <c:forEach items="${orders}" var="order">
    <table class="table table-bordered">
	    <tr>
	      <td scope="col">订单号：${order.orderNo} <span class="mr-5">下单时间：<fmt:formatDate value="${order.created}"/></span> </td>
	      <td scope="col" colspan="2">实付金额：${order.actualPrice}</td>
	    </tr>
	  <tbody>

	  	<c:forEach items="${order.courses}" var="course" varStatus="status">
	  	<c:set value="${course.title}" var="subject"/>
	    <tr>
	      <td scope="row" width="500"><img src="${course.img}" width="100"/> ${course.title }</td>
	      <td width="150">￥${course.price}</td>
	      <td>
	      <c:if test="${status.index==0}">   
		      <c:if test="${order.status=='0'}"><a class="btn btn-primary" href="my/order_pay.jsp?orderNo=${order.orderNo}&actualPrice=${order.actualPrice}&subject=${subject}">去支付</a></c:if>
		      <c:if test="${order.status=='1'}">		      
		      已支付 (<c:if test="${order.payChannel=='alipay'}">支付宝</c:if><c:if test="${order.payChannel=='weixin'}">微信支付</c:if>)
		      <p><small>${order.payTime}</small></p></c:if>	      
	      </c:if>
	      </td>
	    </tr>
	    </c:forEach>
	  </tbody>
	</table>
	</c:forEach>
    
    </div>
    <div class="clearfix"></div>
  </div>


<%@ include file="../footer.jsp" %>
<script>
$(function(){
		
})
</script>